<template>
    <!-- <div v-if="!OtherUser.length">
        <EyeOutlined />
        <span> 查看</span>
    </div> -->
    <a-dropdown placement="topRight" @mouseenter="GetOtherUserCode">
        <div>
            <EyeOutlined />
            <span> 查看</span>
        </div>
        <template #overlay>
            <a-menu v-if="OtherUser.length">
                <a-menu-item v-for="item in OtherUser">
                    <div @click="PreviewOtherUser(item)">{{ item.nickname }}</div>
                </a-menu-item>
            </a-menu>
        </template>
    </a-dropdown>
</template>
<script lang="ts" setup>
import { EyeOutlined } from '@ant-design/icons-vue'
import { ref } from 'vue';
import apis from '@/apis/home'

const emit = defineEmits(['ShowPreview', 'PreviewOtherUser'])

const props = defineProps({
    id: String,
    Status: Number,
})

const OtherUser = ref<any[]>([]);
const GetOtherUserCode = () => {
    if (props.Status == 3 && !OtherUser.value.length) {
        apis.OtherUserInspectList({ id: props.id }).then((res: any) => {
            OtherUser.value = res;
        })
    };
}
function PreviewOtherUser(data: any) {
    emit('PreviewOtherUser', data);
}
</script>
<style lang="less" scoped>

</style>